//数组的解构
const arr = [100, 200, 300];
const foo = arr[0];
const bar = arr[1];
const baz = arr[2];

const [foo, bar, baz] = arr;
const [foo, ...rest] = arr; // ...rest只可用在最后一个元素，返回剩余元素的数组
const [foo, bar, baz, more] = arr; //more为undefined
const [foo,bar,baz,more='default value']//more为'default value'
console.log(foo, bar, baz);
